25#include "yaml-cpp/yaml.h"
40 Loader(
int flags = RTLD_LAZY);
48 void load(std::string _libname_with_so);
56 void close(std::string _libname_with_so);
64 void*
isLoaded(std::string _libname_with_so)
const;
76 static std::set<std::string>
searchPlugins(
const YAML::Node& _node, std::list<YAML::Node>& _visited_nodes);
82 std::list<YAML::Node>& _visited_nodes,
83 const std::string& field);
Loader of shared libraries (e.g. wolf plugins) with dlopen.
Definition: loader.h:32
size_t size() const
Returns the number of loaded libraries.
Definition: loader.cpp:116
void loadPlugin(std::string _plugin)
Loads the library of a wolf plugin ('libwolf<plugin>')
Definition: loader.cpp:63
void load(std::string _libname_with_so)
Loads a library (if not loaded)
Definition: loader.cpp:46
void searchAndLoadPlugins(const YAML::Node &_node)
Loads the plugins of all the 'plugin' fields of a YAML node.
Definition: loader.cpp:121
void close(std::string _libname_with_so)
Closes a loaded library.
Definition: loader.cpp:68
void closePlugin(std::string _plugin)
Closes the library of a wolf plugin.
Definition: loader.cpp:89
std::map< std::string, void * > name_resources_
Loaded libraries: dlopen handles indexed by library name.
Definition: loader.h:35
static std::set< std::string > searchFieldsRecursive(const YAML::Node &_node, std::list< YAML::Node > &_visited_nodes, const std::string &field)
Returns the values of all the fields with a given name of a YAML node, recursively (skipping visited ...
Definition: loader.cpp:133
void * isLoaded(std::string _libname_with_so) const
Returns the handle of a library if it is loaded (nullptr otherwise)
Definition: loader.cpp:94
void * isLoadedPlugin(std::string _plugin) const
Returns the handle of the library of a wolf plugin if it is loaded (nullptr otherwise)
Definition: loader.cpp:111
int flags_
dlopen flags
Definition: loader.h:34
~Loader()
Destructor, closing all the loaded libraries.
Definition: loader.cpp:38
Loader(int flags=RTLD_LAZY)
Constructor from the dlopen flags, loading the core plugin.
Definition: loader.cpp:31
static std::set< std::string > searchPlugins(const YAML::Node &_node, std::list< YAML::Node > &_visited_nodes)
Returns the values of all the 'plugin' fields of a YAML node.
Definition: loader.cpp:128
Definition: capture_base.h:23
std::shared_ptr< Loader > LoaderPtr
Definition: loader.h:89